<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>

<html xmlns="http://www.w3.org/1999/xhtml">

	<head>

		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

		<title><?php echo C('WEB_TITLE');?></title>

		<link rel="stylesheet" type="text/css" href="/Public/css/common.css"/>

		<link rel="stylesheet" type="text/css" href="/Public/js/layui/css/layui.css" media="all"/>

		<link rel="stylesheet" href="/Public/js/datepicker/datepicker.css"/>

		<link rel="stylesheet" type="text/css" href="/Public/crm/css/index.css"/>

		<link rel="stylesheet" type="text/css" href="/Public/crm/css/style.css"/>

		<link rel="stylesheet" href="<?php echo C('PC_ICON_HTTP');?>">

		<script type="text/javascript" >

			const moduleName = "<?php echo (MODULE_NAME); ?>";

		</script>

        <link rel="stylesheet" href="/Public/js/viewer/css/viewer.min.css">
		
		<link rel="stylesheet" type="text/css" href="/Public/js/select2/select2.css" media="all"/>

		<script type="text/javascript" src="/Public/js/jquery-1.9.1.min.js"></script>
		
		<script type="text/javascript" src="/Public/js/jquery-ui.min.js"></script>

		<script type="text/javascript" src="/Public/js/cookie/jquery.cookie.js"></script>

		<script type="text/javascript" src="/Public/js/lang/<?php echo (getStrToLower(cookie('think_language'))); ?>.js"></script>

		<script type="text/javascript" src="/Public/js/colorpicker.js"></script>

		<script type="text/javascript" src="/Public/js/layer/layer.js"></script>

		<script type="text/javascript" src="/Public/js/layui/layui.js"></script>

        <script type="text/javascript" src="/Public/js/feeldesk.js"></script>

        <script type="text/javascript" src="/Public/crm/js/index.js"></script>

        <script type="text/javascript" src="/Public/js/jquery.nicescroll.js"></script>

		<script type="text/javascript" src="/Public/js/clipboard.min.js"></script>

		<script type="text/javascript" src="/Public/js/select2/select2.min.js"></script>

		<script type="text/javascript" src="/Public/js/select2/jquery.core.js"></script>

	</head>

<body>

<script type="text/javascript" src="/Public/js/datepicker/datepicker.all.js"></script>

<script type="text/javascript" src="/Public/js/datepicker/moment.min.js"></script>

<script type="text/javascript" src="/Public/js/datepicker/datepicker.en.js"></script>

    <div class="fd-right-main">

        

    <div class="feeldesk-form pd0 feelcrm-form">

		<div class="form-nav">

            <ul>

                <li><a href="javascript:" class="form-tab active"><?php echo L('MODIFY_CONTACT_RECORDS');?></a></li>

				<?php if(!empty($detailtype)): ?><a href="javascript:history.go(-1);" class="feelcrm-cancleBtn fr mt5 mr30"><?php echo L('CANCEL');?></a><?php endif; ?>

            </ul>

        </div>

        <div class="layui-tab-content form-content pb0 follow-tocreate">

			<form action="<?php echo U('customer/edit_follow',['id'=>encrypt($followup['follow_id'],'FOLLOW'),'detailtype'=>encrypt($detailtype,$detailsource)]);?>" class="layui-form" method="post" enctype="multipart/form-data">

                <div class="layui-tab-item layui-show ">

					 <div class="form-item">

						<div class="layui-form-item">

							<div class="layui-input-inline wd100">

								<textarea class="layui-input" name="follow[content]" id="follow_content"><?php echo ($followup["content"]); ?></textarea>

							</div>

						</div>

						 <div class="layui-form-item relative">

							 <div class="layui-input-inline">

								 <button type="button" class="layui-btn layui-btn-primary uploadFile" id="uploadFile"><i class="layui-icon"></i><?php echo L('UPLOAD_ATTACHMENTS');?></button>

								 <ul id="attachments" class="attach-item mt10">

									 <?php if(is_array($followup["createFiles"])): $i = 0; $__LIST__ = $followup["createFiles"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><li>

											 <i class="iconfont icon-fujian"></i>

											 <span><?php echo ($vo['file_name']); ?></span>

											 <span class="iconfont icon-close2 closed" style="cursor: pointer" data-name="<?php echo getQiniuFileName('http://'.$followup['qiniu_domain'].'/',$vo['file_link']);?>"
												   onclick="editDeleteFile(this);"></span>

											 <input type="hidden" name="file[saves][]" value="<?php echo ($vo['save_name']); ?>">

											 <input type="hidden" name="file[links][]" value="<?php echo ($vo['file_link']); ?>">

											 <input type="hidden" name="file[names][]" value="<?php echo ($vo['file_name']); ?>">

											 <input type="hidden" name="file[sizes][]" value="<?php echo ($vo['file_size']); ?>">

											 <input type="hidden" name="file[types][]" value="<?php echo ($vo['file_type']); ?>">

										 </li><?php endforeach; endif; else: echo "" ;endif; ?>

								 </ul>

							 </div>

						 </div>

						<div class="layui-form-item">

							<?php if(empty($followup["clue_id"])): ?><div class="layui-input-inline w200 mb10">

									<select name="follow[contacter_id]">

										<option value=""><?php echo L('CONTACT');?></option>

										<?php if(is_array($contacter)): $i = 0; $__LIST__ = $contacter;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo["contacter_id"]); ?>" <?php if(($vo["contacter_id"]) == $followup['contacter_id']): ?>selected<?php endif; ?>><?php echo ($vo["detail"]["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>

									</select>

								</div><?php endif; ?>

							<div class="layui-input-inline w200 mb10">

								<select name="follow[cmncate_id]" lay-filter="getCmncateReply">

									<option value=""><?php echo L('COMMUNICATION_TYPE');?></option>

									<?php if(is_array($cmncate)): $i = 0; $__LIST__ = $cmncate;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo["cmncate_id"]); ?>" <?php if(($followup["cmncate_id"]) == $vo['cmncate_id']): ?>selected<?php endif; ?>><?php echo ($vo["cmncate_name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>

								</select>

							</div>

							<div class="layui-input-inline w200 mb10 <?php if(empty($reply)): ?>hidden<?php endif; ?>">

								<select name="follow[reply_id]" id="cmncate_reply" lay-filter="ReplyContent">

									<option value=""><?php echo L('CUSTOM_REPLY');?></option>

									<?php if(is_array($reply)): $i = 0; $__LIST__ = $reply;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo["reply_id"]); ?>" <?php if(($followup["reply_id"]) == $vo['reply_id']): ?>selected<?php endif; ?>><?php echo ($vo["reply_content"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>

								</select>

							</div>

							<div class="layui-input-inline w200 mb10">

								 <input type='text' name="follow[nextcontacttime]" readonly class="layui-input cursor layui-form-time" <?php if(!empty($followup["nextcontacttime"])): ?>value="<?php echo (date('Y-m-d H:i:s',$followup["nextcontacttime"])); ?>"<?php endif; ?> id="form_contacttime" placeholder="<?php echo L('NEXT_CONTACT_TIME');?>" >

							</div>

							<div class="layui-input-inline w200 mb10 savefollow">

								<input type="checkbox" name="reply" lay-skin="primary" value="1">

								<span><?php echo L('SAVE_AS_FOLLOW-UP_TEMPLATE');?></span>

							</div>

							<div class="fr">

								<div class="layui-input-inline w100 right mr0 mb10">

									<a href="javascript:" class="layui-btn layui-btn-normal submitForm createfollow"><?php echo L('EDITOR_RECORD');?></a>

								</div>

							</div>

						</div>


					 </div>

				</div>

			</form>

		</div>

    </div>

	<script type="text/javascript" src="/Public/js/submitform.js"></script>
<script type="text/javascript">
	
	layui.use('form',function()
	{
		var form = layui.form;
		
		form.render('checkbox');
		
		form.render('radio');
		
		form.render('select');

	})
	
</script>



    </div>

    </body>

</html>